import { Component, OnInit } from '@angular/core';
import { BladeService } from "../../../shared/blade.service";
import { BladeData } from "app/shared/blade/blade-data";
import { FactoryListComponent } from "./factory-list/factory-list.component";
import { Observable } from "rxjs/Observable";
@Component({
  selector: 'app-factory',
  templateUrl: './factory.component.html',
  styleUrls: ['./factory.component.css'],
  providers: [BladeService]
})
export class FactoryComponent implements OnInit {

  constructor(public bladeService: BladeService) { }
  
    ngOnInit() {
      this.createFarmListtBlade()
    }
    /**
     * 创建风场列表弹出层
     * 
     * 
     * @memberof FactoryComponent
     */
    createFarmListtBlade() {
      let data: BladeData = new BladeData();
      data.id = "factoryList";
      data.title = "厂家列表";    
      data.isClosingDisabled = true;
      let factoryListBlade = this.bladeService.createBlade(FactoryListComponent, data);
      this.bladeService.showBlade(factoryListBlade);
    }
     /**
     * 是否可以离开
     * 
     * 
     * @memberof FactoryComponent
     */
    canDeactivate(): boolean | Observable<boolean> | Promise<boolean> {
      return true;
    }
  
  }
  



// WEBPACK FOOTER //
// ./src/app/module/basic/factory/factory.component.ts